package com.example.mylibrary.testActivity.MVP_BASE;

import android.content.Context;
import android.os.Bundle;

import androidx.annotation.Nullable;

import com.example.mylibrary.testActivity.Basemodule.Permissions_Activity;

public abstract class MVP_Base01_Activity extends Permissions_Activity {
    public Context context;
    /***是否显示标题栏  默认为false 不显示*/
    private boolean isshowtitle = false;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (!isshowtitle) { if (getSupportActionBar() != null) getSupportActionBar().hide(); }
        //设置布局
        setContentView(initLayout());
        context = this;
    }
    /**
     * 设置布局
     * @return
     */
    public abstract int initLayout();
    /**
     * 初始化数据
     */
    public abstract void initData();
    /**
     * Resume
     */
    public abstract void initResume();
    /**
     * 销毁
     */
    public abstract void  initDestroy();
    @Override
    protected void onDestroy() {
        super.onDestroy();
        try{
            initDestroy();
        }catch (Exception e){}
    }
    @Override
    protected void onResume() {
        super.onResume();
        initResume();
    }
}
